package com.aode.music.service.user;

import com.aode.common.bean.response.User;
import com.aode.common.bean.web.Result;
import com.aode.common.header.Header;
import com.aode.common.url.UrlGather;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface UserService {
    //登录
    @Headers(Header.JSON_HEADER)
    @POST(UrlGather.LOGIN_URL)
    Observable<Result<User>> login(@Body RequestBody requestBody);

    //注册
    @Headers(Header.JSON_HEADER)
    @POST(UrlGather.REGISTER_URL)
    Observable<Result> register(@Body RequestBody requestBody);


    @Headers(Header.JSON_HEADER)
    @GET(UrlGather.GET_USER_URL)
    Observable<Result<User>> getUser(@Query("userId")String userId);
}
